package chen.web.config.spring;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import chen.web.favorite.FavoriteManager;
import chen.web.favorite.FavoriteManagerImpl;
import chen.web.favorite.Showable;
import chen.web.user.AccountManager;

/**
 * 
 * 为避免和controller相互依赖而导致注入对象为空的现象，将此配置从SpringConfig中分离
 * @author chen
 *
 */
@Configuration
public class FavoriteManagerConfig {

	//资源的url接口集合
	private @Autowired Showable[] showable;
	private @Autowired AccountManager accountManager;
	
	
	//收藏管理
	public @Bean FavoriteManager favoriteManager(){
		return 	new FavoriteManagerImpl(accountManager, showable);
	}
}
